<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 联想
  Date: 2024/12/20
  Time: 11:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>private message</title>
    <link rel="stylesheet" href="static/private.css" />
</head>
<body>
<div class="all">
    <h2>让我们一起私聊吧</h2>
    <form action="<%=request.getContextPath()%>/PrivateServlet" method="post">
    <div class="input">
        <label for="object">你想对:</label>
        <input type="text" name="object" id="object"/>
        <div id="error" style="color:red">${error_which}</div>
    </div>
    <div class="input-box">
        <label >说的话：</label>
        <textarea rows="20" cols="80"  id="text" name="text"></textarea>
    </div>
        <div class="bottom">
        <button type="submit" class="button">发送</button>
        <button type="reset"  class="button">重置</button>
    </div>
    </form>
  <div class="outputplace">
    <div id="output1" class="output1">
        <c:forEach var="pri" items="${sessionScope.privates}">
            <p><strong>${pri.username}</strong>对<strong>${pri.privatename}</strong>说: ${pri.message} (${pri.time})</p>
        </c:forEach>
    </div>
      <div id="output2" class="output2">
          <c:forEach var="own" items="${sessionScope.owners}">
              <p><strong>${own.username}</strong>对你说: ${own.message} (${own.time})</p>
          </c:forEach>
      </div>
  </div>
</div>
</body>
</html>
